home *** CD-ROM | disk | FTP | other *** search
- unit RichOle;
-
- interface
-
- uses
- Windows, RichEdit, ActiveX, OleCtnrs, ComObj, Menus;
-
- type
- IRichEditOleCallback = interface(IUnknown)
- ['{00020D03-0000-0000-C000-000000000046}']
- function GetNewStorage: IStorage; safecall;
- procedure GetInPlaceContext(out Frame: IOleInPlaceFrame;
- out Doc: IOleInPlaceUIWindow; var FrameInfo: TOleInPlaceFrameInfo); safecall;
- procedure ShowContainerUI(fShow: Bool); safecall;
- procedure QueryInsertObject(const ClsID: TCLSID; Stg: IStorage; CP: Longint); safecall;
- procedure DeleteObject(OleObj: IOleObject); safecall;
- procedure QueryAcceptData(dataobj: IDataObject; var cfFormat: TClipFormat;
- reCO: DWord; fReally: Bool; hMetaPict: HGlobal); safecall;
- function ContextSensitiveHelp(fEnterMode: Bool): HResult; stdcall;
- function GetClipboardData(const ChRg: TCharRange; reCO: DWord; out DataObj: IDataObject): HResult; stdcall;
- procedure GetDragDropEffect(fDrag: Bool; grfKeyState: DWord;
- var dwEffect: DWord); safecall;
- procedure GetContextMenu(SelType: Word; OleObj: IOleObject;
- const ChRg: TCharRange; var Menu: HMenu); safecall;
- end;
-
- // Structure passed to GetObject and InsertObject
- TREObject = record
- cbStruct: DWord; // size of structure in bytes
- cp: Longint; // character position of object
- ClsID: TClsID; // class identifier of object
- pOleObj: IOleObject; // OLE object interface
- pStg: IStorage; // associated storage interface
- pOleSite: IOleClientSite; // associated client site interface
- sizel: TSize; // size of object (may be 0,0)
- dvaspect, // display aspect to use
- dwFlags, // object status flags
- dwUser: DWord; // user-defined value
- end;
-
- IRichEditOle = interface
- ['{00020D00-0000-0000-C000-000000000046}']
- procedure GetClientSite(out lplpOleSite: IOleClientSite); stdcall;
- function GetObjectCount: Longint; stdcall;
- function GetLinkCount: Longint; stdcall;
- function GetObject(iObj: Longint; out reobject: TREObject;
- dwFlags: DWord): HResult; stdcall;
- function InsertObject(const reobject: TREObject): HResult; stdcall;
- function ConvertObject(iObj: Longint; const clsidNew: TClsId;
- lpStrUserTypeNew: lpCStr): HResult; stdcall;
- function ActivateAs(const clsId, clsIdAs: TClsId): HResult; stdcall;
- function SetHostNames(lpstrContainerApp,
- lpstrContainerObj: lpCStr): HResult; stdcall;
- function SetLinkAvailable(iObj: Longint; fAvailable: Bool): HResult; stdcall;
- function SetDvaspect(iObj: Longint; dvaspect: DWord): HResult; stdcall;
- function HandsOffStorage(iObj: Longint): HResult; stdcall;
- function SaveCompleted(iObj: Longint; stg: IStorage): HResult; stdcall;
- function InPlaceDeactivate: HResult; stdcall;
- function ContextSensitiveHelp(fEnterMode: Bool): HResult; stdcall;
- function GetClipboardData(const chrg: TCharRange; reco: DWord;
- out dataobj: IDataObject): HResult; stdcall;
- function ImportDataObject(dataobj: IDataObject; cf: TClipFormat;
- hMetaPict: HGlobal): HResult; stdcall;
- end;
-
- const
- RECO_PASTE = 0; // paste from clipboard
- RECO_DROP = 1; // drop
- RECO_COPY = 2; // copy to the clipboard
- RECO_CUT = 3; // cut to the clipboard
- RECO_DRAG = 4; // drag
-
- implementation
-
- end.
-